package leetcode.day_2021_03_15_2021_03_21;

/**
 * 62. 不同路径
 * https://leetcode-cn.com/problems/unique-paths/
 */
public class LeetCode0062 {

    public static int uniquePaths(int m, int n) {
        int[][] track = new int[m][n];
        for (int i=0; i<m; i++) {
            track[i][0] = 1;
        }
        for (int i=0; i<n; i++) {
            track[0][i] = 1;
        }
        for (int i=1; i<m; i++) {
            for (int j=1; j<n; j++) {
                track[i][j] = track[i-1][j] + track[i][j-1];
            }
        }
        return track[m-1][n-1];
    }


    public static void main(String[] args) {
        System.out.println(uniquePaths(3, 7));
    }
}
